import basicConfig from './basics/index'
import layoutConfig from './layout/index'
import { cloneDeep } from 'lodash';

export const components = [...basicConfig.list,...layoutConfig.list]

const list = [];
// [basicConfig].forEach(item => {
cloneDeep([basicConfig,layoutConfig]).forEach(item => {
  item.list.forEach(ite => {
    console.log(9, ite);
    ite.formConfig?.formList.map(it => {
      console.log(11, ite[it.key]);
      console.log(12, typeof (ite[it.key]) === "boolean");
      if (!ite[it.key] || !ite[it.key].length || JSON.stringify(ite[it.key]) !== "{}") {
        console.log(12, it.default, typeof (it.default) === "boolean");
        ite[it.key] = typeof (it.default) === "boolean" ? it.default : it.default || ''
        console.log(ite[it.key]);
      }
    })
    delete ite.formConfig
  })
  list.push(item)
});

console.log(14, list);

console.log(18, components);

export default list 